package com.gouqi.mall.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.format.annotation.DateTimeFormat;

import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author:小费
 * @time:2020-2-7
 */
@ApiModel(value = "意见")
public class Suggestion {
    @ApiModelProperty(value = "意见id")
    private Integer id;
    @ApiModelProperty(value = "意见内容")
    private String suggestion;
    @ApiModelProperty(value = "意见人ID")
    private String userId;
    @ApiModelProperty(value = "意见人姓名或者昵称")
    private String userName;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @ApiModelProperty(value = "发表意见时间,创建时间，格式：yyyy-MM-dd HH:mm:ss",example="2020-04-01 15:59:30")
    private String createTime;

    public Suggestion() {
    }

    public Suggestion(Integer id, String suggestion, String userId, String userName, String createTime) {
        this.id = id;
        this.suggestion = suggestion;
        this.userId = userId;
        this.userName = userName;
        this.createTime = createTime;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getSuggestion() {
        return suggestion;
    }

    public void setSuggestion(String suggestion) {
        this.suggestion = suggestion;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        // SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
        // createTime = String.valueOf(df.format(new Date()));// new Date()为获取当前系统时间
        this.createTime = createTime;
    }

    @Override
    public String toString() {
        return "Suggestion{" +
                "id=" + id +
                ", suggestion='" + suggestion + '\'' +
                ", userId='" + userId + '\'' +
                ", userName='" + userName + '\'' +
                ", createTime=" + createTime +
                '}';
    }
}
